home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 038a / mousebas.zip / MOUSE.TXT < prev   
Text File  |  1991-09-02  |  6KB  |  200 lines

  1. ********************************************************************************
  2.  
  3.                  PROGRAMING THE MOUSE WITH BASIC
  4.  
  5.                            BY SKIPPY
  6. ********************************************************************************
  7.  
  8.  
  9. DEAR PROGRAMER:
  10.  
  11.   WITH THE MOUSE BECOMING EVER MORE POPULAR IN TODAYS SOFTWARE I DECIDED TO 
  12. LEARN TO PROGRAM THE MOUSE TO GIVE THE PROGRAM THAT LITTLE "POLISHED" LOOK.
  13.  
  14.   I LOOKED FOR A LONG TIME TO FIND INFORMATION ABOUT WRITING PROGRAMS USING THE
  15. MOUSE. BUT AFTER MANY CALLS TO OTHER BBS'S AND LOOKING IN BOOKS, I FOUND NOTHING
  16. OR JUST VERY LITTLE. SO I DECIDED TO DIG IN AND SPEND MANY LATE NIGHTS (AS MANY
  17. PROGRAMMERS KNOW) LOOKING AT HOW THEY DID IT IN OTHER LANGUGES.
  18.  
  19.   I HOPE YOU HAVE FUN USING THE FOLLOWING INFORMATION!!!
  20.  
  21. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  22.  
  23.  
  24.  
  25. DONT BE ONE OF THE MANY WHO USE SHARWARE PROGRAMS AND NEVER PAY!!!!
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34. PLEASE SEND $5.00 TO        STEVEN BRITTON
  35.                             6930 S. 20TH ST #2305
  36.                             OAK CREEK, WI 53154
  37.                             (414) 761-3662 
  38.  
  39.  
  40. I HAVE PUT ALOT OF TIME INTO THIS, AND WILL MAKE MANY MORE SO WATCH THE BBS'S!
  41.  
  42. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  43.  
  44.  
  45.  
  46. SPECIAL OFFER:
  47.  
  48. FOR THE TOTAL PRICE OF $7.00                          $5.00 MY EFFORTS
  49.                                                       $2.00 DISKETE AND POSTAGE
  50.                                                       ------
  51.                                                       $7.00
  52.  
  53. I WILL SEND YOU MUCH MORE DOCUMENTED INFORMATION ON THE MOUSE AND EVEN A FEW
  54. SECRETS, ALONG WITH SOME GOOD MOUSE PROGRAMS I WROTE!
  55.  
  56. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  57.  
  58.  
  59.  
  60.  
  61.                          PROGRAMING THE MOUSE WITH BASIC
  62.                                        BY
  63.                                 STEVEN BRITTON
  64.  
  65.  
  66.  
  67. 1. SYSTEM REQUIREMENTS:               IBM OR CLONE (100%) COMPUTER
  68.                                       MOUSE
  69.                                       MOUSE DRIVER
  70.                                       A BASIC LANG
  71.  
  72.  
  73.  
  74. I want you to enjoy the information givin here and feel free to pass it to 
  75. friends or even use the info in your own programs (But dont forget to send the 
  76. $5.00 please)
  77.  
  78.  
  79. 2. While writting this little package I tried to keep in mind a couple of things
  80.  
  81. a. Keep it short
  82. b. Keep it simple and easy to understand
  83. c. Dont write a huge .DOC file that takes a long time to read.
  84. d. Let you be able to jump in as soon as possible!!
  85.  
  86.  
  87.  
  88. 3. I put this package together on a 386sx 16 with 2meg and a 107HD.
  89.  
  90.     Basic Languages I have tested this on:      TURBO BASIC (BORLAND Co.)
  91.                                                 GW BASIC (MICROSOFT INC.)
  92.                                                 QBASIC (MICROSOFT INC.)
  93.  
  94.   I originally wrote it all on and tested it in TURBO BASIC. I know many 
  95. basic programers may not like it, but it works good for me (for now).
  96.  
  97.  
  98. 4. The first thing you must do is find out where the mouse driver is in memory.
  99.    The following is a very simple way of doing it.
  100.  
  101.    10 DEF SEG=0
  102.    20 MOUSEG=256*PEEK(207)+PEEK(206)
  103.    30 MOUSE=256*PEEK(205)+PEEK(204)+2
  104.    40 DEF SEG=MOUSEG
  105.  
  106.  
  107.    TO SEE IF A MOUSE DRIVER IS INSTALLED:
  108.  
  109.    50 IF (MOUSEG OR (MOUSE-2)) AND PEEK(MOUSE-2)<> 207 THEN GOTO 70
  110.    60 PRINT "MOUSE DRIVER NOT FOUND!": END
  111.    
  112.  
  113.    Next is to reset the mouse driver:
  114.  
  115.    70 M1%=0
  116.    80 CALL MOUSE(M1%,M2%,M3%,M4%)
  117.  
  118.    
  119.    Now to show the mouse pointer:
  120.  
  121.    90 M1%=1
  122.    100 CALL MOUSE (M1%,M2%,M3%,M4%)
  123.  
  124.  
  125.    NOTE:  WHEN DOING THE CALL STATMENT YOU MAY HAVE TO USE THE FOLLOWING
  126.           INSTEAD (TURBO BASIC,ECT...)
  127.      
  128.           CALL ABSOLUTE MOUSE(M1%,M2%,M3%,M4%)
  129.  
  130.  
  131.  
  132.  
  133. 5. Now some notes to help you on the basics.
  134.    When you run it for the first time notice that the pointer DOES NOT flicker!
  135.    You dont have to draw it, erase it, draw it,... as when moving items normally
  136.    so dont worry about that. If you run it as is you will find it very quick,
  137.    simple, easy to understand.
  138.  
  139.    Now to understand some more basics:
  140.    
  141.    When placing values in M1% and making a call you can get differnt results.
  142.    
  143.    example:   90 M1%=2
  144.               100 CALL MOUSE (M1%,M2%,M3%,M4%)
  145.            
  146.               NOW THE POINTER IS INVISIBLE!!!
  147.  
  148.  
  149.  
  150.  
  151.               90 M1%=3
  152.               100 CALL MOUSE (M1%,M2%,M3%,M4%)
  153.               110 IF M2%=1 THEN PRINT "LEFT BUTTON PRESSED"
  154.               120 IF M2%=2 THEN PRINT "RIGHT BUTTON PRESSED"
  155.               130 IF M2%=3 THEN PRINT "BOTH BUTTONS PRESSED"
  156.               140 PRINT M3%: REM   HORIZONTAL CURSOR POSITION
  157.               150 PRINT M4%: REM   VERTICAL CURSOR POSITION
  158.               160 GOTO 100
  159.  
  160.   Now I think you are getting the hang of it (I hope!!!)
  161.  
  162.   I want you to understand two things:
  163.  
  164.    1. By putting different numbers in the M1% (M1%=?) you can get diffent results
  165.       by checking the values of the other 3 (M2%,M3%,M4%) after you do the call
  166.       to the mouse (CALL MOUSE ECT...)
  167.  
  168.    2. Every time you want to retrieve info on the mouse (button status, cursor
  169.       position, ect...) you must make a call to the mouse with the correct
  170.       value going to the mouse in M1%. So it may be in a loop if you are always
  171.       checking to see if the buttons were pressed.    
  172.  
  173.  
  174. The following are a few (just a few) of values to put in M1% before making a 
  175. call to the mouse and the results. (As I mentioned before, if you send me $7.00
  176. I will send you a disk with ALL the values and the results along many other 
  177. programs and ect...)
  178.  
  179.  
  180. M1% value                    RESULTS
  181. ---------                    -------
  182.  
  183. 0                            M1% mouse status (-1 if found and reset, 0 if other)
  184.  
  185. 1                            nothing, shows cursor
  186.  
  187. 2                            hide the cursor
  188.  
  189. 3                            get mouse position and get button status
  190.  
  191.  
  192.  
  193. Now there are Many additional items that I wont cover here, but you can do many
  194. things and get alot of information from the mouse. You can even change the
  195. pointer to anything you want!! (You design, pencil, hand, face,ect... UNLIMITED)
  196.  
  197.  
  198. Just have fun!!!
  199.  
  200.